#ifndef __LOCKGUARD_HPP__
#define __LOCKGUARD_HPP__

#include<pthread.h>

class LockGuard {

public:
  LockGuard(pthread_mutex_t* pmtx)
    :_pmtx(pmtx)
  {
    pthread_mutex_lock(_pmtx);

  }

  ~LockGuard() {
    pthread_mutex_unlock(_pmtx);
  }


private:
  pthread_mutex_t* _pmtx;
};


#endif
